﻿using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.OleDb;

namespace DAO
{   
    public class DataProvider
    {
        //Khai bao duong dan den Database
        protected static string chuoiketnoi = "Provider=Microsoft.Jet.OleDb.4.0;Data Source=QuanLyHocSinh.mdb";
        protected static OleDbConnection ketnoi = null;

        protected static OleDbConnection Connect()
        {
            ketnoi = new OleDbConnection(chuoiketnoi);
            ketnoi.Open();
            return ketnoi;
        }

        protected static void Disconnect()
        {
            if (ketnoi.State == System.Data.ConnectionState.Open)
            {
                ketnoi.Close();
            }
        }
    }
}
